package factoryGame;


import game.constants.ReferenceObject;
import game.constants.ReferenceSpecialFeature;
import interfaces.impl.HumanInteraction;
import objects.SpetialFeature;
import objects.WorldObject;
import actions.ActionActivateObject;
import actions.ActionBuildStarcraftObject;
import actions.ActionCreateStarcraftObject;
import actions.ActionDie;
import actions.ActionDropObject;
import actions.ActionGatherMineral;
import actions.ActionGatherVespeneGas;
import actions.ActionGiveMinerals;
import actions.ActionGiveVespeneGas;
import actions.ActionIncreaseLife;
import actions.ActionModifySpetialFeature;
import actions.ActionMove;
import actions.ActionObjectFinish;
import actions.ActionPickUpObject;
import actions.ActionReciveAttack;
import actions.ActionReciveMinerals;
import actions.ActionReciveVespeneGas;
import actions.ActionXYtoMove;
import agents.AgentAttack;
import agents.AgentBuild;
import agents.AgentBuildFinish;
import agents.AgentCreateStarcraftObject;
import agents.AgentDie;
import agents.AgentFollow;
import agents.AgentGiveVespeneGas;
import agents.AgentMove;
import agents.AgentMoveMonster;
import agents.AgentRefineryVespeneGas;
import agents.AgentSearchTargetToAttack;
import agents.interaction.InteractionAttackObject;
import agents.interaction.InteractionBuildAcademy;
import agents.interaction.InteractionBuildBarrack;
import agents.interaction.InteractionBuildCommandCenter;
import agents.interaction.InteractionBuildRefinery;
import agents.interaction.InteractionCreateFireBat;
import agents.interaction.InteractionCreateMarine;
import agents.interaction.InteractionCreateSCV;
import agents.interaction.InteractionGatherMineral;
import agents.interaction.InteractionGatherVespeneGas;
import agents.interaction.InteractionMovePlayer;
import extra.Position;

public final class ObjectFactory {
	
	
	static HumanInteraction humanInteraction;
	static SpetialFeature feature;
	
	public final static WorldObject createWorldObject(int id, int idCliente,double x, double y,int assignSpecialFeature ){
		WorldObject object= new WorldObject();
		
	
		object.setObjectReference(id);
		object.setImageObject(ImageObjectFactory.createImageObject(id));
		System.out.println("REFERENCEE DEL OBJEcT "+object.getObjectReference());
		//System.out.println(object.getImageObject().getImageToShow().getHeight());
		//System.out.println(object.getImageObject().getCollisionShape().getHeight());
		object.setOwner(idCliente);
		object.setPosition(new Position(x, y));
		switch (id){
		
		case ReferenceObject.OBJECT_REFERENCE_MINERALS:
			
			object.addAction(new ActionDie());
			object.addAction(new ActionIncreaseLife());
			object.addAction(new ActionGatherMineral());
			
			object.addAgent(new AgentDie());
			
			if(assignSpecialFeature == constants.Constants.NO_ASSIGN_SPECIAL_FEATURE){
				break;
			}
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_VESPENE_GAS:
			
			object.addAction(new ActionDie());
			object.addAction(new ActionActivateObject());
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_COMMAND_CENTER1:
			
			object.addAction(new ActionModifySpetialFeature());
			object.addAction(new ActionReciveAttack());
			object.addAction(new ActionDie());
			object.addAction(new ActionCreateStarcraftObject());
			object.addAction(new ActionIncreaseLife());
			object.addAction(new ActionDropObject());
			object.addAction(new ActionReciveMinerals());
			object.addAction(new ActionReciveVespeneGas());
			
			
			
			humanInteraction = new InteractionCreateSCV();
			
			object.addHumanInteraction(humanInteraction);
			
			object.setOwner(1);
			object.addAgent(new AgentDie());
			object.addAgent(new AgentCreateStarcraftObject());
		
			
			if(assignSpecialFeature == constants.Constants.NO_ASSIGN_SPECIAL_FEATURE){
				break;
			}
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_MINERAL_QUANTITY);
			feature.setValue(100); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_SCV_PRICE);
			feature.setValue(50); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE_INCREASE_PER_SECOND);
			feature.setValue(50); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VESPENE_GAS_QUANTITY);
			feature.setValue(100); 
			object.addSpetialFeature(feature);
			
			
						
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_BARRACK1:
			
			object.addAction(new ActionModifySpetialFeature());
			object.addAction(new ActionReciveAttack());
			object.addAction(new ActionDie());
			object.addAction(new ActionCreateStarcraftObject());
			object.addAction(new ActionIncreaseLife());
			object.addAction(new ActionDropObject());
			object.addAction(new ActionObjectFinish());
			
			humanInteraction = new InteractionCreateMarine();
			
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionCreateFireBat();
			
			object.addHumanInteraction(humanInteraction);
			
			object.addAgent(new AgentDie());
			object.addAgent(new AgentCreateStarcraftObject());
			object.addAgent(new AgentBuildFinish());

			if(assignSpecialFeature == constants.Constants.NO_ASSIGN_SPECIAL_FEATURE){
				break;
			}
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_MARINE_PRICE);
			feature.setValue(50); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_FIRE_BAT_PRICE);
			feature.setValue(50); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_FIRE_BAT_VESPENE_GAS);
			feature.setValue(25); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE_INCREASE_PER_SECOND);
			feature.setValue(5); 
			object.addSpetialFeature(feature);
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_ACADEMY1:
			
			object.addAction(new ActionModifySpetialFeature());
			object.addAction(new ActionReciveAttack());
			object.addAction(new ActionDie());
			object.addAction(new ActionIncreaseLife());
			object.addAction(new ActionObjectFinish());
			
			object.addAgent(new AgentDie());
			
			object.addAgent(new AgentBuildFinish());

			if(assignSpecialFeature == constants.Constants.NO_ASSIGN_SPECIAL_FEATURE){
				break;
			}
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_MARINE_PRICE);
			feature.setValue(50); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE_INCREASE_PER_SECOND);
			feature.setValue(5); 
			object.addSpetialFeature(feature);
			
						
			break;
		case ReferenceObject.OBJECT_REFERENCE_REFINERY1:
			
			object.addAction(new ActionModifySpetialFeature());
			object.addAction(new ActionReciveAttack());
			object.addAction(new ActionDie());
			object.addAction(new ActionIncreaseLife());
			object.addAction(new ActionObjectFinish());
			object.addAction(new ActionPickUpObject());
			object.addAction(new ActionGiveVespeneGas());
			object.addAction(new ActionDropObject());
			object.addAction(new ActionActivateObject());
			
			object.addAgent(new AgentGiveVespeneGas());
			object.addAgent(new AgentRefineryVespeneGas());
			
			if(assignSpecialFeature == constants.Constants.NO_ASSIGN_SPECIAL_FEATURE){
				break;
			}
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VESPENE_GAS_QUANTITY);
			feature.setValue(1000); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VESPENE_GAS_QUANTITY_TO_GATHER);
			feature.setValue(8); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TIME_TO_GATHER_VESPENE_GAS);
			feature.setValue(3000); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
		
			
			break;
			
		
		case ReferenceObject.OBJECT_REFERENCE_SVC1:
			
			object.addAction(new ActionModifySpetialFeature());
			object.addAction(new ActionMove());
			object.addAction(new ActionDie());
			object.addAction(new ActionIncreaseLife());
			object.addAction(new ActionXYtoMove());
			object.addAction(new ActionBuildStarcraftObject());
			object.addAction(new ActionObjectFinish());
			object.addAction(new ActionGatherVespeneGas());
			
			object.addAction(new ActionReciveAttack());
			object.addAction(new ActionReciveMinerals());
			object.addAction(new ActionReciveVespeneGas());
			object.addAction(new ActionGiveMinerals());
			object.addAction(new ActionGiveVespeneGas());

			object.addAgent(new AgentMove());
			object.addAgent(new AgentAttack());
			object.addAgent(new AgentFollow());
			object.addAgent(new AgentDie());
			object.addAgent(new AgentBuild());
			
			
			humanInteraction = new InteractionMovePlayer();
			
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionAttackObject();
			
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionGatherMineral();
			
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionGatherVespeneGas();
			
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionBuildBarrack();
			
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionBuildAcademy();
			
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionBuildCommandCenter();
			
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionBuildRefinery();
			
			object.addHumanInteraction(humanInteraction);
			
			object.setOwner(1);
			
			if(assignSpecialFeature == constants.Constants.NO_ASSIGN_SPECIAL_FEATURE){
				break;
			}
			
			//adding special features
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_TO_MOVE);
			feature.setValue(x);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_TO_MOVE);
			feature.setValue(y);
			object.addSpetialFeature(feature);
			
			object.addSpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_MOVING));
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_SPEED);
			feature.setValue(0.08);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
						
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VISION_RANGE);
			feature.setValue(600);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_ATTACK);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_FOLLOW);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE);
			feature.setValue(3);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_RANGE);
			feature.setValue(75);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME);
			feature.setValue(2000); //each two seconds;
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TIME_TO_GATHER_MINERAL);
			feature.setValue(5000); //each 5 seconds;
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_MINERAL_QUANTITY_TO_GATHER);
			feature.setValue(8); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_MINERAL_QUANTITY);
			feature.setValue(0); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TIME_TO_GATHER_VESPENE_GAS);
			feature.setValue(3000); //each 5 seconds;
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VESPENE_GAS_QUANTITY_TO_GATHER);
			feature.setValue(8); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VESPENE_GAS_QUANTITY);
			feature.setValue(0); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_BARRACK_PRICE);
			feature.setValue(20); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ACADEMY_PRICE);
			feature.setValue(10); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_COMMAND_CENTER_PRICE);
			feature.setValue(40); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_REFINERY_PRICE);
			feature.setValue(40); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_BUILDING);
			feature.setValue(constants.Constants.TRUE); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_OBJECT_ID_TO_BUILD);
			feature.setValue(constants.Constants.NO_OBJECT_ID); 
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE_INCREASE_PER_SECOND);
			feature.setValue(10); 
			object.addSpetialFeature(feature);
			
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_MARINE1:
			
			object.addAction(new ActionModifySpetialFeature());
			object.addAction(new ActionMove());
			object.addAction(new ActionDie());
			object.addAction(new ActionIncreaseLife());
			object.addAction(new ActionXYtoMove());
			
			object.addAction(new ActionObjectFinish());
			object.addAction(new ActionReciveAttack());

			object.addAgent(new AgentMove());
			object.addAgent(new AgentAttack());
			object.addAgent(new AgentFollow());
			object.addAgent(new AgentDie());
			object.addAgent(new AgentSearchTargetToAttack());
			
			
			humanInteraction = new InteractionMovePlayer();
			
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionAttackObject();
			
			object.addHumanInteraction(humanInteraction);
			
			object.setOwner(1);
			
			if(assignSpecialFeature == constants.Constants.NO_ASSIGN_SPECIAL_FEATURE){
				break;
			}
			
			//adding special features
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_TO_MOVE);
			feature.setValue(x);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_TO_MOVE);
			feature.setValue(y);
			object.addSpetialFeature(feature);
			
			object.addSpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_MOVING));
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_SPEED);
			feature.setValue(0.08);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
						
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VISION_RANGE);
			feature.setValue(400);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_ATTACK);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_FOLLOW);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE);
			feature.setValue(5);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_RANGE);
			feature.setValue(250);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME);
			feature.setValue(2000); //each two seconds;
			object.addSpetialFeature(feature);
			
						
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_BUILDING);
			feature.setValue(constants.Constants.TRUE); 
			object.addSpetialFeature(feature);
			
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE_INCREASE_PER_SECOND);
			feature.setValue(10); 
			object.addSpetialFeature(feature);
			
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_FIREBAT1:
			
			object.addAction(new ActionModifySpetialFeature());
			object.addAction(new ActionMove());
			object.addAction(new ActionDie());
			object.addAction(new ActionIncreaseLife());
			object.addAction(new ActionXYtoMove());
			
			object.addAction(new ActionObjectFinish());
			object.addAction(new ActionReciveAttack());	
			
			object.addAgent(new AgentMove());
			object.addAgent(new AgentAttack());
			object.addAgent(new AgentFollow());
			object.addAgent(new AgentDie());
			object.addAgent(new AgentSearchTargetToAttack());
			
			humanInteraction = new InteractionMovePlayer();
			
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionAttackObject();
			
			object.addHumanInteraction(humanInteraction);
			
			object.setOwner(1);
			

			if(assignSpecialFeature == constants.Constants.NO_ASSIGN_SPECIAL_FEATURE){
				break;
			}
			
			//adding special features
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_TO_MOVE);
			feature.setValue(x);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_TO_MOVE);
			feature.setValue(y);
			object.addSpetialFeature(feature);
			
			object.addSpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_MOVING));
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_SPEED);
			feature.setValue(0.08);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
						
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VISION_RANGE);
			feature.setValue(400);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_ATTACK);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_FOLLOW);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE);
			feature.setValue(15);
			object.addSpetialFeature(feature);
				
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_RANGE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME);
			feature.setValue(2000); //each two seconds;
			object.addSpetialFeature(feature);
			
						
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_BUILDING);
			feature.setValue(constants.Constants.TRUE); 
			object.addSpetialFeature(feature);
			
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE_INCREASE_PER_SECOND);
			feature.setValue(10); 
			object.addSpetialFeature(feature);
			
			break;

			
		case ReferenceObject.OBJECT_REFERENCE_COMMAND_CENTER2:
			object = createWorldObject(ReferenceObject.OBJECT_REFERENCE_COMMAND_CENTER1, idCliente, x, y,assignSpecialFeature);
			object.setOwner(2);
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_BARRACK2:
			object = createWorldObject(ReferenceObject.OBJECT_REFERENCE_BARRACK1, idCliente, x, y,assignSpecialFeature);
			object.setOwner(2);
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_ACADEMY2:
			object = createWorldObject(ReferenceObject.OBJECT_REFERENCE_ACADEMY1, idCliente, x, y,assignSpecialFeature);
			object.setOwner(2);
			
			break;
			
		
		case ReferenceObject.OBJECT_REFERENCE_SVC2:
			object = createWorldObject(ReferenceObject.OBJECT_REFERENCE_SVC1, idCliente, x, y,assignSpecialFeature);
			object.setOwner(2);
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_MARINE2:
			object = createWorldObject(ReferenceObject.OBJECT_REFERENCE_MARINE1, idCliente, x, y,assignSpecialFeature);
			object.setOwner(2);
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_FIREBAT2:
			
			object = createWorldObject(ReferenceObject.OBJECT_REFERENCE_FIREBAT1, idCliente, x, y,assignSpecialFeature);
			object.setOwner(2);
			break;	
			
		case ReferenceObject.OBJECT_REFERENCE_RAT:
			//adding actions
			object.addAction(new ActionMove());
			object.addAction(new ActionModifySpetialFeature());
			object.addAction(new ActionXYtoMove());
			object.addAction(new ActionReciveAttack());
			object.addAction(new ActionDie());
			
			
			
			//adding agents
			object.addAgent(new AgentMove());
			object.addAgent(new AgentDie());
		//	object.addAgent(new AgentAttack());
		//	object.addAgent(new AgentAttackMonster());
			object.addAgent(new AgentMoveMonster());
			
			//adding special features
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_TO_MOVE);
			feature.setValue(x);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_TO_MOVE);
			feature.setValue(y);
			object.addSpetialFeature(feature);
			
			object.addSpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_MOVING));
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_SPEED);
			feature.setValue(0.03);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VISION_RANGE);
			feature.setValue(900);
			object.addSpetialFeature(feature);
			
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_BEGIN_AREA_TO_MOVE);
			feature.setValue(1);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_BEGIN_AREA_TO_MOVE);
			feature.setValue(1);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_END_AREA_TO_MOVE);
			feature.setValue(1000);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_END_AREA_TO_MOVE);
			feature.setValue(1000);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(20);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(20);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_FOLLOW);
			feature.setValue(6);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_ATTACK);
			feature.setValue(6);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE);
			feature.setValue(5);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_RANGE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME);
			feature.setValue(2000); //each two seconds;
			object.addSpetialFeature(feature);
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_BONES1:
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_BACKGROUND_1:
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_BACKGROUND_2:
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_BACKGROUND_3:
			
			break;
		default:
			object.setObjectReference(ReferenceObject.OBJECT_REFERENCE_BACKGROUND_1);
			System.out.println("NO ENCUENTRO LA IMAGEN EN OBJECT FACTORY y mi objectReference es: "+id);
			break;
			
		}
		return object;
		
	}

}
